Skip to content

fix(FilterPicker): optimizations#1105

Merged
tenphi merged 7 commits intomainfrom
fix-filter-picker-optimizations
Apr 1, 2026
Merged

fix(FilterPicker): optimizations#1105
tenphi merged 7 commits intomainfrom
fix-filter-picker-optimizations

Conversation

@tenphi
Copy link
Copy Markdown
Member

@tenphi tenphi commented Mar 31, 2026

Note

Medium Risk
Refactors FilterPicker/Picker popover state and selection/sorting flows; while intended as a perf improvement, it changes open/close and sorting timing and could introduce subtle UI regressions.

Overview
Improves FilterPicker and Picker performance by making the DialogTrigger popover fully controlled (isOpen/onOpenChange), moving popover lifecycle effects out of the trigger render path, and memoizing trigger summary rendering.

Optimizes selection label/key handling by building memoized Map lookups (and reusing a shared _internalCollection in FilterPicker) instead of per-render/per-key scans, and measures trigger width only when opening to avoid layout reads on every render.

Updates selected-item sorting so it is computed and cached only while the popover is open, clears caches on close/items changes, and adds useWarn warnings when sortSelectedToTop is used without the items prop; also extracts duplicated multi-select toggling logic into a new shared utils/selection.ts (processSelectionArray).

Written by Cursor Bugbot for commit 7ae9c6b. This will update automatically on new commits. Configure here.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 31, 2026

🦋 Changeset detected

Latest commit: 7ae9c6b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cube-dev/ui-kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cube-ui-kit Ready Ready Preview, Comment Apr 1, 2026 2:50pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

📦 NPM canary release

Deployed canary version 0.0.0-canary-6fd9868.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

🏋️ Size limit report

Name Size Passed?
All 360.87 KB (+0.03% 🔺) Yes 🎉
Tree shaking (just a Button) 101.22 KB (0% 🟰) Yes 🎉

Click here if you want to find out what is changed in this build

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

🧪 Storybook is successfully deployed!

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread src/components/fields/FilterPicker/FilterPicker.tsx
The processSelectionArray function was extracted to src/utils/selection.ts
but the file was not committed, causing build failures.

Made-with: Cursor
@tenphi tenphi merged commit afa9483 into main Apr 1, 2026
16 checks passed
@tenphi tenphi deleted the fix-filter-picker-optimizations branch April 1, 2026 15:32
@github-actions github-actions Bot mentioned this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant